Promise.resolve().then(() => {
    console.log('p1');
    Promise.resolve().then(() => {
        console.log('p2');
        setTimeout(() => {
            console.log('s3')
        }, 0)
        Promise.resolve().then(() => {
            console.log('p4')
        })
    })

    setTimeout(() => {
        console.log('s5');
        Promise.resolve().then(() => {
            console.log('p6')
        })
        setTimeout(() => {
            console.log('s7')
        }, 0)
    }, 0)

    setTimeout(() => {
        console.log('s8');
        Promise.resolve().then(() => {
            console.log('p9')
        })
    }, 0)
})

setTimeout(() => {
    console.log('s10');
    Promise.resolve().then(() => {
        console.log('p11')
    })
}, 0);

// 浏览器：p1 p2 p4 s10 p11 s5 p6 s8 p0 s3 s7
// Node: p1 p2 p4 s10 s5 s8 p11 p6 p9 s3 s7